#include <bits/stdc++.h>
using namespace std;

char buf[(int)5e7], *fs = buf;

typedef long long ll;

const ll BlueMoonLWZ = (int) 1e9 + 7;

inline ll gn() {
    ll k = 0, f = 1;
    char c = *fs++;
    for (; !isdigit(c); c = *fs++) if (c == '-') f = -1;
    for (; isdigit(c); c = *fs++) k = k * 10 + c - '0';
    return k * f;
}

inline ll md(ll &a) {
    if (a > BlueMoonLWZ) 
        a %= BlueMoonLWZ;
    if (a < 0) 
        (a += BlueMoonLWZ) %= BlueMoonLWZ;
    return a;
}

struct node {
    ll sum, lz1, lz2;
    node *ls, *rs;
    node() {
        ls = rs = NULL;
        sum = lz1 = lz2 = 0;
    }
    void pd(int len) {
        
    }
} *root;

#define mid ((l + r) >> 1)

node *build(int l, int r) {
    node *x = new node();
    if (l == r) {
        x->sum = gn() % BlueMoonLWZ;
        return x;
    } else {
        x->ls = build(l, mid);
        x->rs = build(mid + 1, r);
        md(x->sum = x->ls->sum + x->rs->sum);
    }
}

void qufan(node *x, int l, int r, int s, int t) {
    x->pd(r - l + 1);
    if (l == s and r == t) {
        x->lz1 = 1;
        x->sum = (-x->sum + BlueMoonLWZ) % BlueMoonLWZ;
    }
    else {
        if (t <= mid) qufan(x->ls, l, mid, s, t);
        else if (s > mid) qufan(x->rs, mid + 1, r, s, t);
        else qufan(x->ls, l, mid, s, mid), qufan(x->rs, mid + 1, r, mid + 1, t);
    }
}

int main() {

}